import * as THREE from 'three'
import { Stage } from '../jsm/Stage.js'

window.THREE = THREE;

export class HelloBox {
  constructor(stage) {
    const box = this.addBox(10);
    stage.scene.add(box)
  }

  addBox(size) {
    var geometry = new THREE.BoxGeometry(size, size, size);
    var material = new THREE.MeshBasicMaterial({
      color: 0x63e42a,
      emissive: 0x072534,
      side: THREE.DoubleSide,
    })
    var cube = new THREE.Mesh(geometry, material);
    cube.name = "test_cube"
    return cube;
  }
}

window.onload = () => {
  const stage = new Stage("#app");
  window.stage = stage;
  stage.run();
  new HelloBox(stage);
};
